﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=FileLanguage.rename_file_or_folder %>
</asp:Content>
<asp:content id="Content2" contentplaceholderid="MainContent" runat="server">
    <%= Html.ValidationSummary(FileLanguage.error)%>
    
            <h2><%=FileLanguage.rename_file_or_folder %></h2>
             <table width="100%">
            <tr>
            <th style="width: 40px">
            <img src="/content/files/Stuffed_Folder.png" style="height: 32px; " alt="root" />
            </th>
            <th>
            <%= Html.ActionLink(Membership.ApplicationName, "Index", new { id = string.Empty })%>
            <%string path = (string)ViewData["dir"];
                    string[] drs = path.Remove(0, 2).Replace("()", "/").Split('/');
                    string p = "";
                    foreach (string st in drs)
                    {
                        if (st == drs[drs.Length - 1])
                        {%>/<%=st%><%}
                        else
                        {
                            p += "()" + st;%>
            /<a href="<%=Url.Action("Index", "File", new{id=p})%>"><%=st%></a>
            <% }
                    }
                 %>
            </th>
            </tr>
            </table>
            <table style="width: 100%;">
                <tr>
                    <% using (Html.BeginForm("Rename", "File", new { id = path, t = Request.QueryString["t"] }))
                       {%>
                    <th><p>
                        <%=FileLanguage.choose_new_name %></p><p>
                        <%= Html.TextBox("name", ViewData["name"].ToString())%></p>
                        <p><input type="submit" value="<%=FileLanguage.rename %>"/></p>
                    </th>
                    <% } %>
                </tr>
            </table>
            <a href="<%=Url.Action("Index", "File", new{id=path.Remove(path.LastIndexOf("()"))})%>"><%=FileLanguage.back_to_list %></a>
</asp:content>
